﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FactoryClsssLib.Strategy
{
    /// <summary>
    /// 1、加法策略
    /// </summary>
    public class OperationAdd : IStrategy
    {
        public int DoOperation(int num1, int num2)
        {
            return num1 + num2;
        }
    }

    /// <summary>
    /// 4、除法策略
    /// </summary>
    public class OperationDivision : IStrategy
    {
        public int DoOperation(int num1, int num2)
        {
            return num1 / num2;
        }
    }

    /// <summary>
    /// 2、与运算
    /// </summary>
    public class OperationH : IStrategy
    {
        public int DoOperation(int num1, int num2)
        {
            return num1 | num2;
        }
    }

    /// <summary>
    /// 3、乘法策略
    /// </summary>
    public class OperationMultiply : IStrategy
    {
        public int DoOperation(int num1, int num2)
        {
            return num1 * num2;
        }
    }

    /// <summary>
    /// 2、减法策略
    /// </summary>
    public class OperationSubtract : IStrategy
    {
        public int DoOperation(int num1, int num2)
        {
            return num1 - num2;
        }
    }

    /// <summary>
    /// 2、与运算
    /// </summary>
    public class OperationY : IStrategy
    {
        public int DoOperation(int num1, int num2)
        {
            return num1 & num2;
        }
    }
}
